﻿@using SCMS.Resources
@model SCMS.UI.Models.PPModel

@{AjaxOptions ajaxOpts = new AjaxOptions
{
    UpdateTargetId = "ppDiv",
    LoadingElementId = "loading",
    HttpMethod = "Post",
    Url = Url.Action("SaveProcPlan")
};}
<script src="@Url.Content("~/Scripts/js/jquery-1.7.2.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<div class="partialViewCard">
    <div class="partialViewCardHeader"><h3>@ViewBag.FormHeader</h3></div>
    <br />
    @using (Ajax.BeginForm(null, null, ajaxOpts, new { @class = "form" }))
    {
        @Html.ValidationSummary(true)
        @Html.HiddenFor(m => m.EntityPP.Id)
        <table width="98%" align="center" cellpadding="0">
            <tr>
                <th align="center" width="33.3%">
                    @Resources_frank.Global_String_ProjectTitle
                </th>
                <th align="center" width="33.3%">
                    @Resources_frank.Budget_CategoryList_ProjectNo
                </th>
                <th align="center" width="33.3%">
                    @Resources_frank.Budget_CategoryList_Donor
                </th>
            </tr>
            <tr>
                <td align="center">
                    @Html.DropDownListFor(x => x.ProjectId, Model.Projects, Resources_frank.Global_String_PleaseSelect, new { @id = "dplProject", onchange = "javascript:selectedIndexChangePONos4PP(this)" })
                    @Html.ValidationMessageFor(x => x.ProjectId)
                    @Html.HiddenFor(x => x.EntityPP.RefNumber)
                </td>
                <td align="center">
                    <div id="ProjectNoDiv">
                        @Html.DropDownListFor(x => x.EntityPP.ProjectDonorId, Model.ProjectDonors, Resources_frank.Global_String_PleaseSelect, new { @id = "dplProNo", onchange = "javascript:GetDonor(this)" })
                        @Html.ValidationMessageFor(x => x.EntityPP.ProjectDonorId, Resources_frank.Global_String_Required)</div>
                </td>
                <td align="center">
                    <div id="donorDiv" style="font-size: 12px;">
                        @ViewBag.Donor
                    </div>
                </td>
            </tr>
            <tr>
                <th align="center">
                    @Resources_frank.OrderRequest_AddPPItems2OR_OfficePreparing
                </th>
                <th align="center">
                    @Resources_frank.Global_String_DatePrepared
                </th>
                <th align="center">
                    
                </th>
            </tr>
            <tr>
                <td align="center" valign="top">
                    @Html.DropDownListFor(x => x.EntityPP.PreparingOfficeId, Model.SubOffices, Resources_frank.Global_String_PleaseSelect)
                    @Html.ValidationMessageFor(x => x.EntityPP.PreparingOfficeId, Resources_frank.Global_String_Required)
                </td>
                <td align="center" valign="top">
                    @Html.EditorFor(x => x.EntityPP.PreparedOn)
                    @Html.ValidationMessageFor(x => x.EntityPP.PreparedOn)
                </td>
                <td align="right">
                    <input type="submit" class="btn green" value="  @Resources_frank.Global_String_Proceed  " />
                </td>
            </tr>
        </table>    
    }
</div>